package task

import "github.com/gogf/gf/v2/os/gtime"

type DocumentArchiveInput struct {
	Type string   `json:"type"`
	Urls []string `json:"urls"`
}

// Tasks is the golang structure for table tasks.
type Tasks struct {
	Id             uint        `orm:"id,primary"      json:"id"`             //
	Uuid           string      `orm:"uuid"            json:"uuid"`           // 任务id，uuid
	Type           string      `orm:"type"            json:"type"`           // 类型
	Status         string      `orm:"status"          json:"status"`         //
	Progress       uint        `orm:"progress"        json:"progress"`       // 处理进度，0 - 100
	NodeId         uint        `orm:"node_id"         json:"nodeId"`         // 处理任务的节点
	RetryTimes     uint        `orm:"retry_times"     json:"retryTimes"`     // 重试次数
	ProcessedAt    *gtime.Time `orm:"processed_at"    json:"processedAt"`    // 开始处理时间
	CompletedAt    *gtime.Time `orm:"completed_at"    json:"completedAt"`    // 任务完成时间
	WaitingTime    uint        `orm:"waiting_time"    json:"waitingTime"`    // 等待时间
	ProcessingTime uint        `orm:"processing_time" json:"processingTime"` // 任务处理时长
	Sort           uint        `orm:"sort"            json:"sort"`           //
	CreatedBy      uint        `orm:"created_by"      json:"createdBy"`      //
	CreatedAt      *gtime.Time `orm:"created_at"      json:"createdAt"`      //
	UpdatedAt      *gtime.Time `orm:"updated_at"      json:"updatedAt"`      //
	DeletedAt      *gtime.Time `orm:"deleted_at"      json:"deletedAt"`      //
}

// TaskExtends is the golang structure for table task_extends.
type TaskExtends struct {
	Id      uint   `orm:"id,primary" json:"id"`      //
	TaskId  uint   `orm:"task_id"    json:"taskId"`  //
	Input   string `orm:"input"      json:"input"`   //
	Output  string `orm:"output"     json:"output"`  //
	Extends string `orm:"extends"    json:"extends"` //
}
